import styles from './button.module.scss'

export function IconButton(props: {
  onClick: () => void;
  icon?: any;
  className?: string;
  title?: string;
  text?: string;
  backgroundColor?: string;
}) {
  const { backgroundColor } = props
  const buttonStyle = {
    backgroundColor
  }
  return (
    <button className={styles["icon-button"]} onClick={props.onClick} style={buttonStyle}>
      { props.icon && <div className={styles["icon"]}>{props.icon}</div> }
      { props.text && <div className={styles["text"]}>{props.text}</div> }
    </button>
  )  
}